<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\9\25 0025
 * Time: 14:37
 */

namespace app\Lib\Model\SysConfig\SetConfig;


use app\Lib\Model\DbModel\AdminConfig;

class GetConfigList implements \app\Lib\InterfaceIn\SysConfig\SetConfig\GetConfigList
{
    private $group;
    public function __construct($group)
    {
        $this->group = $group;
    }

    /**
     * 获取配置分组数据
     * @return false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function run()
    {
        $model  =  (new AdminConfig());
        $map    = [
            $model->_group=>$this->group,
            $model->_status=>1
        ];
        $result = $model->where($map)->select();
        return $result;
    }

}